<?php
include("functions.php");
//this file need to konw the keyboard preference

$key_pref = $_GET["key_pref"];

//Text String propose to use GNU Gettext $victor

if($key_pref=="bur")
{
	//if the keyboard pref is in bur
	
	//strings
	$keyboard="uD;bkwf";
	$burmese = "jrefrm";
	$burglish = "t*Fvdyf";
	$word = "<div id=word_label>pum;vHk;</div>";
	$definition = "<div id=def_label>t\"dyg,f</div>";
	$example = "<div id=example_label>Oyrm</div>";
	$list_synonyms = "cifAsm;pmvHk;eJY t\"dy�g,fqif wJh wjcm;pmvHK;awG? cyfqifqifpmvHk;awG? pmvHk;aygif;rSm;aeus pmvHk;awG &Sd&if yk'fuav;eJY jcm;jyD; a&;ay;cJhygvm;/ aus;Zl;/";
	$tags = "owfyHkuGJ";
	$your_name_will_appear = "eHrnf (ajymif) &,f? ae&m&,f cifAsm;pmvHk;&JU ab;em;rSm &SdaerSm";
	$name = "eHrnf (ajymif)";
	$inenglish = "spell it in english";
	$continue = "'kd;xm;";

	//css style classes
	$textdark = "textdarkb";
	$button = "buttonb";
	$textarea = "textareab";
	$textbox = "textboxb";
	
	//tool tip messages
	$word_tooltip = "brf;pum;";
	
	//error message
	$error_message = "<div id=error class = textdarkbFormError style=\"display: none\">teDa&mifpmvHk;awGeJh jyxm;wJhae&mawGukd jznfhay;yg/ aus;Zl;/</div>";
}

else
{
	//if the keyboard preference is in bglish
	
	//strings
	$keyboard = "Keyboard";
	$burmese = "Burmese";
	$burglish = "Burglish";
	$word = "<div id=word_label>Word</div>";
	$definition = "<div id=def_label>Definition</div>";
	$example = "<div id=example_label>Example</div>";
	$list_synonyms = "List synonyms, related words and common misspellings, separated by commas.";
	$tags = "Tags";
	$your_name_will_appear = "The (nick) name and location you enter below will appear next to the entry.";
	$name = "Your (nick) name";
	$inenglish = "in english";
	$continue = "Continue";  //button
	
	
	//css style classes
	$textdark = "textdark";
	$button = "button";
	$textarea = "textarea";
	$textbox = "textbox";
	
	//tool tips
	$word_tooltip = "the slang you are about to define";
	
	//error message
	$error_message = "<div id=error class = textdarkFormError style=\"display: none\">please fill out the required fields marked in red</div>";
}



$edit = $_GET["edit"];

if($edit==0)
{
	
}
else if($edit==1)
{
	
	$word_to_edit = $_POST["word"];
	$word_to_edit = htmlspecialchars($word_to_edit, ENT_QUOTES);
	
	$definition_to_edit = $_POST["definition"];
	
	$example_to_edit = $_POST["example"];
	
	//$tags_to_edit = $_POST["tags"];
	//$tags_to_edit = htmlspecialchars($tags_to_edit, ENT_QUOTES);
	
	$name_to_edit = $_POST["author"];
	$name_to_edit = htmlspecialchars($name_to_edit, ENT_QUOTES);
	if($key_pref=="bur")
	{
		$inenglish_to_edit = $_POST["inenglish"];
		$inenglish_to_edit = htmlspecialchars($inenglish_to_edit, ENT_QUOTES);
	}
	
	

}
else if($edit==2)
{
	
	//redefine is coming from search result
	$word_to_edit = $_GET["word"];
	$word_to_edit =  burmese_special_char_decoder($word_to_edit);
	$word_to_edit = htmlspecialchars($word_to_edit);
	//echo $word_to_edit;
	
}
?>









<HTML>
<HEAD>
<TITLE>Word Rebel</TITLE>
<SCRIPT LANGUAGE="JavaScript">

function go(loc) {
window.location.href = loc;
}

</script>


<link rel="stylesheet" type="text/css" href="default.css">
<script language="JavaScript" src="javascript_functions.js"></script>
</HEAD>
<BODY bgcolor="999966">




<TABLE BORDER="0" CELLPADDING=0 CELLSPACING=0 width="683" align="center">


	<TR>
		<TD valign="top" colspan="3"><img src="images/title-gawdi.gif"
			border=0 width="683" height="71"></TD>
	</TR>



	<TR>
		<TD valign="top" colspan="3">

		<P><BR>
		<!-- MENU -->
		<? print_main_menu(); ?>


		</TD>
	</TR>






	<TR>
		<TD valign="top"><!-- LEFT COL -->








		<TABLE BORDER="0" CELLPADDING=0 CELLSPACING=0 width="464">

			<TR>
				<TD colspan="3"><img src="images/page_top.gif" border=0
					width="464" height="27"></TD>
			</TR>

			<TR>
				<TD background="images/page_left.gif" width="23"><img
					src="images/space.gif" border=0 width="17" height="1"></TD>

				<TD bgcolor="CCCC99"><img src="images/space.gif" border="0"
					width="428" height="1"><BR>

				<!-- start of form -->
				<? echo $error_message;?>
				<form onSubmit="return checkForm(<? echo "'".$key_pref."'"; ?>);" name="entry" action="confirm.php?key_pref=<? echo $key_pref; ?>&edit=0"
				method=post>
				<table border="0" cellpadding="0" cellspacing="5">

					<tr> 
						
						<td class=<? echo $textdark; ?> ><? echo $keyboard; ?></td>
						<td class=<? echo $textdark; ?>> <input type="radio" name="language" value="bur"
							onClick="go('add.php?key_pref=bur&edit=0');"<? if($key_pref=="bur")echo "checked";  ?>> <? echo $burmese; ?> <input
							type="radio" name="language" value="bglish"
							onClick="go('add.php?key_pref=bglish&edit=0');"<? if($key_pref!="bur")echo "checked";  ?>> <? echo $burglish; ?> <br>

						</td>
					</tr>
					<tr>
						<td class=<? echo $textdark; ?>><? echo $word; ?></td>
						<!--  tool tip
						<td><input type="text" name="word" id=word cols="40" class=<? echo $textbox; if($edit>0)echo " value=\"".$word_to_edit."\"";?> 
						onMouseover="ddrivetip(<?echo "'".$word_tooltip."'"; ?>,'150','lightyellow',<? echo "'".$key_pref."'"; ?>)";
 						onMouseout="hideddrivetip()">
						 
						 </td>
						 
						 -->
						 <td><input type="text" name="word" id=word cols="40" onfocus="setCurrentObj(this)"  class=<? echo $textbox; if($edit>0)echo " value=\"".$word_to_edit."\"";?> >
						
					</tr>
					<?
					if($key_pref=="bur")
					{
						echo "
						<tr>
							<td class=textdark>$inenglish</td>
							<td><input type=\"text\" name=\"english\" id=english size=\"40\" onfocus=\"setCurrentObj(this)\" class=textbox";
						
						if($edit==1)echo " value=\"".$inenglish_to_edit."\"";
						
						echo "></td>
						</tr> ";
					}
					
					
					?>

					<tr valign="top">
						<td class=<? echo $textdark; ?>><? echo $definition; ?></td>
						<td><textarea name="definition" id=definition cols="30" rows="8" onfocus="setCurrentObj(this)"
							wrap="virtual" class=<? echo $textarea; ?>><? if($edit==1) echo $definition_to_edit; ?></textarea></td>
					</tr>
					<tr valign="top">
						<td class=<? echo $textdark; ?>><? echo $example; ?></td>
						<td><textarea name="example" id=example cols="30" rows="8" onfocus="setCurrentObj(this)"
							wrap="virtual" class=<? echo $textarea;  ?>><? if($edit==1) echo $example_to_edit; ?></textarea></td>
					</tr>
					
					<!-- 
					<tr>
						<td colspan="2" class=<? echo $textdark; ?>><i> <? echo $list_synonyms; ?></i></td>
					</tr>
					 -->
					 
					 
					<?
						//$tags_to_edit = htmlspecialchars($tags_to_edit, ENT_QUOTES);
					?>
					
					<!--  
					<tr>
						<td class=<? echo $textdark; ?>><? echo $tags; ?></td>
						<td><input type="text" name="tags" size="40" class=<? echo $textbox; if($edit==1)echo " value=\"".$tags_to_edit."\"";?>></td>
					</tr>
					-->
					
					<!--  
					<tr>
						<td colspan="2" class=<? echo $textdark; ?>><i><? echo $your_name_will_appear; ?></i></td>
					</tr>
					-->
					
					<?
						//$name_to_edit = htmlspecialchars($name_to_edit, ENT_QUOTES);
					?>
					<tr>
						<td nowrap class=<? echo $textdark; ?>><? echo $name; ?></td>
						<td><input type="text" name="author" size="40" onfocus="setCurrentObj(this)" class=<? echo $textbox;if($edit==1)echo " value=\"".$name_to_edit."\""; ?>
						></td>
					</tr>
					
					<tr valign="center">
						<td></td>
						<td colspan="2"><input type="submit" value="<? echo $continue; ?>" class=<? echo $button; ?>></td>
					</tr>


				</table>
				</form>
				<!--  end of form --></TD>

				<TD background="images/page_right.gif" width="19"><img
					src="images/space.gif" border=0 width="16" height="1"></TD>

			</TR>


			<TR>
				<TD colspan="3"><img src="images/page_bott.gif" border=0
					width="464" height="22"></TD>
			</TR>


		</TABLE>





		<!-- END LEFT COL --></td>

		<td><img src="images/space.gif" border=0 width="11" height="1"></td>





		<TD valign=top align=center><!-- START RIGHT COLUMN TOP -->





		<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 width="208">

			<TR>
				<TD colspan="3"><img src="images/x_top.gif" border=0
					width="208" height="175"></TD>
			</TR>

			<TR>
				<TD background="images/star_left.gif" width="17"><img
					src="images/space.gif" border=0 width="17" height="1"></TD>

				<TD bgcolor="CC3300" align=center><img src="images/space.gif" border=0
					width="176" height="1"><BR>
					
				<? if($key_pref=="bglish") burglish_content_right_top();?>
				
				<!-- keyboard layout start -->
				<!-- example for doing the overaly 
				<a href="#" onClick="return overlay(this, 'hidden_burmese_layout', 'rightbottom')">Show Content</a>
				-->
				<? 
				
				   if($key_pref=="bur") 
				   {
				   		//echo "<a href=\"#\" onClick=\"show('hidden_burmese_layout');\">Click2Type</a><br> ";
				   		echo "<a href=\"#\" onClick=\"show('hidden_burmese_layout');\">Click2Type<br>Click me if u dare!</a> ";
				   		//print_burmese_layout();
				  		//print_hidden_keyboard_layout();
				  		
				   }
				?>
				
				
				</TD>

				<TD background="images/star_right.gif" width="17"><img
					src="images/space.gif" border=0 width="17" height="1"></TD>

			</TR>


			<TR>
				<TD colspan="3"><img src="images/star_bott.gif" border=0
					width="208" height="22"></TD>
			</TR>


		</TABLE>
		
		<? 
				
				   if($key_pref=="bur") 
				   {
				   		//echo "<div class=a onClick=\"show('hidden_burmese_layout');\">Show Burmese Keyboard Layout</div> ";
				   		//print_burmese_layout();
				  		print_hidden_keyboard_layout();
				  		
				  		echo "<script type=\"text/javascript\">

				Drag.init(document.getElementById(\"hidden_burmese_layout\"));
				</script>";
				  		
				   }
				?>
				
<!--  
				<script type="text/javascript">

				Drag.init(document.getElementById("hidden_burmese_layout"));
				</script>
-->
				<!-- keyboard layout end -->


		<!-- END RIGHT COLUMN TOP --> 
		
		
		<!--  start right column bottom -->
		
		


		<!-- END RIGHT COLUMN BOTTOM --></td>







	</tr>






	<tr>
		<td colspan="3" align=center>


		<P><BR>
		<!-- Copyright -->
		<p class="textlight">gollystarz &copy; 2006</p>
		<P><BR>
		</td>
	</tr>




</table>








<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1322223-1";
urchinTracker();
</script>
</BODY>
</HTML>
